<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>javascript回到顶部效果</title>
    <link rel="stylesheet" href="/css/style.css"/>
    <script src="/js/goTop.js"></script>
</head>
<body>
<div class="img-box">
    <img src="img/bg.jpg" alt=""/>
</div>
<a href="javascript:;" id="btn-top"></a>
<script>
    new goTop("btn-top");
</script>
</body>
</html>
